<?php
namespace app\admin\model;
use think\Model;
use think\Db;

/**
 * 关键字zu
 * @package app\admin\model
 */
class BusKeywordGroup extends Model
{
    protected $observerClass = 'app\admin\event\DeleteCache';
    public function getList($request)
    {
        $data = $this
            ->field(true)
            ->order('create_time')
            ->paginate($request['limit'], false,['query' => $request])
            ->each(function($item, $key){

                switch ($item->onoff) {
                    case 0:
                        $item->onoff_ = '停用';
                        break;
                    case 1:
                        $item->onoff_ = '使用中';
                        break;

                    default:
                        $item->onoff_ = '';
                        break;
                }


            });

            return $data->toarray();
    }
}